﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class FlashSaleInfoConfig : EntityTypeConfiguration<FlashSaleInfo>
    {
        public FlashSaleInfoConfig()
        {
            ToTable("Himall_FlashSale");
            Property(item => item.Title).HasColumnType("varchar").HasMaxLength(200);
            Property(item => item.CategoryName).HasColumnType("varchar").HasMaxLength(300);
            Property(item => item.ImagePath).HasColumnType("varchar").HasMaxLength(1000);
            HasRequired(x => x.Himall_Products).WithMany(x => x.Himall_FlashSale).HasForeignKey(x => x.ProductId);          
            HasRequired(x => x.Himall_Shops).WithMany(x => x.Himall_FlashSale).HasForeignKey(x => x.ShopId);
        }
    }
}
